﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MsCreation
{
    class MainGame
    {
        Hero player;
        string answer;
        DataHandler data = new DataHandler();

        public MainGame()
        {
            // Title of the game
            Console.WriteLine("Ms. Creation, she awaits.");
            Console.WriteLine("__________________________");
            Console.WriteLine();

            // initialize hero
            player = new Hero();
            Hero.Initialize(player);

            // Start the game loop
            BasicGameLoop();
        }

        void BasicGameLoop()
        {
            do
            {
                Console.WriteLine();
                Console.Write(@"
Main Menu
_____________
(S)tatus
(L)oad
s(A)ve
(Q)uit
_____________
S,A,L or Q?");
                Console.WriteLine();
                answer = Console.ReadLine();
                Console.WriteLine();
                switch (answer)
                {
                    case "L":
                    case "l":
                        data.Load(player);
                        break;
                    case "S":
                    case "s":
                        Status.PrintStats(player);
                        break;
                    case "A":
                    case "a":
                        data.Save(player);
                        break;
                    case "Q":
                    case "q":
                        Console.WriteLine("Goodbye, {0}.", player.Identifier);
                        Console.ReadLine();
                        break;
                }
            }
            while (answer != "Q" && answer != "q");
        }
    }
}
